import { getFldm } from '@/utils/get-fldm'
export const formItems = async (key: string) => {
  const obj: any = {
    gdaj: [
      {
        disabled: false,
        label: '案件名称',
        prop: 'ajmc',
        type: 'input',
        placeholder: '请输入案件名称',
        iswm: 'Y',
        options: [],
      },
      {
        disabled: false,
        label: '部门受案号',
        prop: 'bmsah',
        type: 'input',
        placeholder: '请输入部门受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '统一受案号',
        prop: 'tysah',
        type: 'input',
        placeholder: '请输入统一受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '检察官',
        prop: 'cbjcg',
        type: 'input',
        placeholder: '请输入检察官',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '归档状态',
        prop: 'gdztdm',
        type: 'select',
        placeholder: '请选择归档状态',
        options: (await getFldm('gd014')).filter(
          (item: any) => item.dm === 'gd0140003' || item.dm === 'gd0140004',
        ),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '归档日期',
        prop: 'gd-rq',
        type: 'daterange',
        placeholderStart: '开始时间',
        placeholderEnd: '结束时间',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '请输入档号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '纸质案卷',
        prop: 'sfzzajdm',
        type: 'select',
        placeholder: '请选择纸质案卷',
        iswm: 'Y',
        options: await getFldm('gd009'),
      },
      {
        disabled: false,
        label: '音像',
        prop: 'sfyspdm',
        type: 'select',
        placeholder: '请选择音像',
        iswm: 'Y',
        options: await getFldm('gd017'),
      },
      {
        disabled: false,
        label: '导出状态',
        prop: 'sjbdcztdm',
        type: 'select',
        placeholder: '请选择导出状态',
        iswm: 'Y',
        nodeKey: 'dm',
        options: await getFldm('gd008'),
      },
    ],
    ddcaj: [
      {
        disabled: false,
        label: '案件名称',
        prop: 'ajmc',
        type: 'input',
        placeholder: '请输入案件名称',
        iswm: 'Y',
        options: [],
      },
      {
        disabled: false,
        label: '部门受案号',
        prop: 'bmsah',
        type: 'input',
        placeholder: '请输入部门受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '统一受案号',
        prop: 'tysah',
        type: 'input',
        placeholder: '请输入统一受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '检察官',
        prop: 'cbjcg',
        type: 'input',
        placeholder: '请输入检察官',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '归档状态',
        prop: 'gdztdm',
        type: 'select',
        placeholder: '请输入归档状态',
        options: await getFldm('gd014'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '归档日期',
        prop: 'gd-rq',
        type: 'daterange',
        placeholderStart: '开始时间',
        placeholderEnd: '结束时间',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '请输入档号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '纸质案卷',
        prop: 'sfzzajdm',
        type: 'select',
        placeholder: '请选择纸质案卷',
        iswm: 'Y',
        options: await getFldm('gd009'),
      },
      {
        disabled: false,
        label: '音像',
        prop: 'sfyspdm',
        type: 'select',
        placeholder: '请选择音像',
        iswm: 'Y',
        options: await getFldm('gd017'),
      },
    ],
    ydcaj: [
      {
        disabled: false,
        label: '案件名称',
        prop: 'ajmc',
        type: 'input',
        placeholder: '请输入案件名称',
        iswm: 'Y',
        options: [],
      },
      {
        disabled: false,
        label: '部门受案号',
        prop: 'bmsah',
        type: 'input',
        placeholder: '请输入部门受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '统一受案号',
        prop: 'tysah',
        type: 'input',
        placeholder: '请输入统一受案号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档号',
        prop: 'dh',
        type: 'input',
        placeholder: '请输入档号',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '归档日期',
        prop: 'gd-rq',
        type: 'daterange',
        placeholderStart: '开始时间',
        placeholderEnd: '结束时间',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '导出人',
        prop: 'dcr',
        type: 'input',
        placeholder: '请输入导出人',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '导出状态',
        prop: 'dcztdm',
        type: 'select',
        placeholder: '请选择导出状态',
        options: await getFldm('gd008'),
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '导出日期',
        prop: 'dc-rq',
        type: 'daterange',
        placeholderStart: '开始时间',
        placeholderEnd: '结束时间',
        iswm: 'Y',
      },
      {
        disabled: false,
        label: '档案接收状态',
        prop: 'dajsztdm',
        type: 'select',
        placeholder: '请选择档案接收状态',
        options: await getFldm('gd005'),
        iswm: 'Y',
      },
    ],
  }

  return obj[key]
}
